/*
 * FlipAnimVertically.java
 *
 * Created on May 5, 2008, 6:01 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package src.engine;
import java.awt.geom.AffineTransform;
import java.awt.image.*;

/**
 *
 * @author Admin
 */
public class FlipAnimHorizontally {

    static private AffineTransform tx;
    static private AffineTransformOp op;

    /**
     * Creates a new instance of FlipAnimVertically
     */
    public FlipAnimHorizontally() {
    }
    
     public static BufferedImage flipMe(BufferedImage bi){
            tx = AffineTransform.getScaleInstance(-1, 1);
            tx.translate(-bi.getWidth(), 0);
            op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
            bi = op.filter(bi, null);
            return bi;
         }
}    
